package com.power.leopard.remote;

import java.util.List;

import com.power.leopard.ConfigManagerLoader;
import com.power.leopard.config.ConfigManager;

public class ServiceFactory {

	static ConfigManager configManager = ConfigManagerLoader.getConfigManager();

	/**
	 * add and publish
	 * 
	 * @param providerConfigList
	 */
	public static void addServices(List<ProviderConfig<?>> providerConfigList) {
		if (providerConfigList != null && !providerConfigList.isEmpty()) {
			for (ProviderConfig<?> providerConfig : providerConfigList) {
				ServiceProviderFactory.addService(providerConfig);
				ServerConfig serverConfig = ProviderBootStrap.startup(providerConfig);
				providerConfig.setServerConfig(serverConfig);
				ServiceProviderFactory.publishService(providerConfig);
			}
		}
	}
}
